
CC = gcc

COMPILE_FLAG = -O0 -Wall

SRC_DIRECTORY := src
BUILD_DIRECTORY := obj
INCLUDES := -I include 

LIB = 

all: file_descriptor fd_and_fp file_copy file_size file_hole file_cat file_cat2 file_fcntl \
	 file_fcntl2

file_descriptor:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_descriptor $(SRC_DIRECTORY)/file_descriptor.c  $(LIBS)

fd_and_fp:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/fd_and_fp $(SRC_DIRECTORY)/fd_and_fp.c  $(LIBS)

file_copy:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_copy $(SRC_DIRECTORY)/file_copy.c  $(LIBS)

file_size:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_size $(SRC_DIRECTORY)/file_size.c  $(LIBS)

file_hole:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_hole $(SRC_DIRECTORY)/file_hole.c  $(LIBS)

file_cat:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_cat $(SRC_DIRECTORY)/file_cat.c  $(LIBS)

file_cat2:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_cat2 $(SRC_DIRECTORY)/file_cat2.c  $(LIBS)

file_fcntl:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_fcntl $(SRC_DIRECTORY)/file_fcntl.c  $(LIBS)

file_fcntl2:
	@test -d $(BUILD_DIRECTORY) || mkdir $(BUILD_DIRECTORY)
	$(CC) -g -rdynamic $(INCLUDES)   $(COMPILE_FLAG)  -o $(BUILD_DIRECTORY)/file_fcntl2 $(SRC_DIRECTORY)/file_fcntl2.c  $(LIBS)


clean:
	rm -rf $(BUILD_DIRECTORY)/*